import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";

Vue.config.productionTip = false;
Vue.use(ElementUI);
Vue.prototype.ROS2D = window.ROS2D;
Vue.prototype.NAV2D = window.NAV2D;
Vue.prototype.CREATEJS = window.CREATEJS

new Vue({
  router,
  render: h => h(App)
}).$mount("#app");

ifTouch();

function ifTouch() {
  var uA = navigator.userAgent.toLowerCase();
  var ipad = uA.match(/ipad/i) == "ipad";
  var iphone = uA.match(/iphone os/i) == "iphone os";
  var midp = uA.match(/midp/i) == "midp";
  var uc7 = uA.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
  var uc = uA.match(/ucweb/i) == "ucweb";
  var android = uA.match(/android/i) == "android";
  var windowsce = uA.match(/windows ce/i) == "windows ce";
  var windowsmd = uA.match(/windows mobile/i) == "windows mobile";
  if (
    !(
      ipad ||
      iphone ||
      midp ||
      uc7 ||
      uc ||
      android ||
      windowsce ||
      windowsmd
    )
  ) {
    // PC 端
    console.log("PC");
  } else {
    // 移动端
    console.log("mobile");
  }
}